﻿using System.Runtime;
using System.Collections.Generic;

namespace System.Reflection
{
    [NonScript]
    public abstract class Module : /*TODO:ISerializable*/ICustomAttributeProvider
    {        
        public static readonly TypeFilter FilterTypeName;
        public static readonly TypeFilter FilterTypeNameIgnoreCase;

        public virtual int MDStreamVersion
        {
            get { return 0; }
        }


        public virtual string FullyQualifiedName
        {
            get { return null; }
        }

        public virtual Guid ModuleVersionId
        {
            get
            {
                return new Guid();
            }
        }

        public virtual int MetadataToken
        {
            get { return 0; }
        }

        public virtual string ScopeName
        {
            get { return null; }
        }

        public virtual string Name
        {
            get { return null; }
        }

        //TODO:Enable if need
        //public virtual Assembly Assembly
        //{
        //    get { return null; }
        //}

        //TODO:Enable if error
        //public ModuleHandle ModuleHandle
        //{
        //    [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        //    get { return null; }
        //}

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        protected Module()
        {
        }

        public static bool operator ==(Module left, Module right)
        {
            return false;
        }

        public static bool operator !=(Module left, Module right)
        {
            return !(left == right);
        }

        public override bool Equals(object o)
        {
            return base.Equals(o);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public override string ToString()
        {
            return this.ScopeName;
        }

        public virtual object[] GetCustomAttributes(bool inherit)
        {
            return null;
        }

        public virtual object[] GetCustomAttributes(Type attributeType, bool inherit)
        {
            return null;
        }

        public virtual bool IsDefined(Type attributeType, bool inherit)
        {
            return false;
        }

        public virtual IList<CustomAttributeData> GetCustomAttributesData()
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public MethodBase ResolveMethod(int metadataToken)
        {
            return null;
        }

        public virtual MethodBase ResolveMethod(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public FieldInfo ResolveField(int metadataToken)
        {
            return null;
        }

        public virtual FieldInfo ResolveField(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public Type ResolveType(int metadataToken)
        {
            return null;
        }

        public virtual Type ResolveType(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public MemberInfo ResolveMember(int metadataToken)
        {
            return null;
        }

        public virtual MemberInfo ResolveMember(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
        {
            return null;
        }

        public virtual byte[] ResolveSignature(int metadataToken)
        {
            return null;
        }

        public virtual string ResolveString(int metadataToken)
        {
            return null;
        }

        //TODO:Enable if error
        //public virtual void GetPEKind(out PortableExecutableKinds peKind, out ImageFileMachine machine)
        //{
        //    return null;
        //}

        //[SecurityCritical]
        //public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        //{
        //}

        //[ComVisible(true), TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public virtual Type GetType(string className, bool ignoreCase)
        {
            return null;
        }

        //[ComVisible(true), TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public virtual Type GetType(string className)
        {
            return null;
        }

        public virtual Type GetType(string className, bool throwOnError, bool ignoreCase)
        {
            return null;
        }

        public virtual Type[] FindTypes(TypeFilter filter, object filterCriteria)
        {
            return null;
        }

        public virtual Type[] GetTypes()
        {
            return null;
        }

        public virtual bool IsResource()
        {
            return false;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public FieldInfo[] GetFields()
        {
            return null;
        }

        public virtual FieldInfo[] GetFields(BindingFlags bindingFlags)
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public FieldInfo GetField(string name)
        {
            return null;
        }

        public virtual FieldInfo GetField(string name, BindingFlags bindingAttr)
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public MethodInfo[] GetMethods()
        {
            return null;
        }

        public virtual MethodInfo[] GetMethods(BindingFlags bindingFlags)
        {
            return null;
        }

        public MethodInfo GetMethod(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
        {
            return null;
        }

        public MethodInfo GetMethod(string name, Type[] types)
        {
            return null;
        }

        public MethodInfo GetMethod(string name)
        {
            return null;
        }

        //TODO:Enable if error
        //public virtual X509Certificate GetSignerCertificate()
        //{
        //    return null;
        //}

        //TODO:Delete internal
        //protected virtual MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
        //{
        //    throw new NotImplementedException();
        //}
        //internal virtual ModuleHandle GetModuleHandle()
        //{
        //    return ModuleHandle.EmptyHandle;
        //}

        //void _Module.GetTypeInfoCount(out uint pcTInfo)
        //{

        //}
        //void _Module.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
        //{

        //}
        //void _Module.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
        //{

        //}
        //void _Module.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
        //{

        //}

        //static Module()
        //{
        //}
    }
}
